#include<iostream>
#include<string>
#include<sstream>
#include<jsoncpp/json/json.h>
int main()
{
    Json::Value root;
    root["name"] = "李四";
    root["sex"] = 1;
    // std::string s = root.toStyledString();
    Json::StreamWriterBuilder sbuilder;
    std::unique_ptr<Json::StreamWriter> write(sbuilder.newStreamWriter());

    std::stringstream ss;

    write->write(root,&ss);
    std::string s = ss.str();

    std::cout<<s<<std::endl;
    return 0;
}